package com.example.unisys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.unisys.entity.CourseSale;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public interface CourseSaleMapper extends BaseMapper<CourseSale> {

//    int insert(CourseSale coursesale);
//
    int insertSelective(CourseSale courseSale);

    int updateSaleByParams(@Param("course_id") String course_id, @Param("main_school") String main_school, @Param("sub_school") String sub_school);

    Integer getByMain(@Param("main_school") String main_school, @Param("course_id") String course_id);

    Integer getBySub(@Param("main_school") String main_school, @Param("sub_school") String sub_school, @Param("course_id") String course_id);

    Integer getAllByMain(@Param("main_school") String main_school);

    Integer getAllBySub(@Param("main_school") String main_school, @Param("sub_school") String sub_school);

    Integer getAll();

    List<CourseSale> getById(@Param("main_school") String main_school, @Param("course_id") String course_id);

    List<CourseSale> getSalesBySearch(Map map);


    List<CourseSale> getSales(Map map);

    Integer getSaleSum(Map map);

    List<Map<String,Object>> getSalesByMain(HashMap<String, Object> hs);

    List<Map<String,Object>>  getSalesBySystem(HashMap<String, Object> hs);

    List<Map<String,Object>>  getSalesBySub(HashMap<String, Object> hs);

    List<CourseSale> getSalesBlur(HashMap<String, Object> hs);

    int getSystemSaleSum();

    List<CourseSale> getAllById(HashMap<String, Object> map);
}
